/*
 * Written by Dustin Striplin
 */

package Model;

public enum Constants {
    APPROVED(1), UNDECIDED(0), REJECTED(-1);
    int value;

    private Constants(int value) {
            this.value = value;
    }
    
    public int getValue() {
    	return this.value;
    }
    
    /**
     * converts an integer to a constant
     * @param val the value we want to convert
     * @return The enum, if val was not a legal value, null is returned.
     */
    public static Constants convertItoConst(int val) {
    	switch(val) {
    	case 1: 	return APPROVED;
    	case 0: 	return UNDECIDED;
    	case -1: 	return REJECTED;
    	default:	return null;
    	}
    }
}